package com.yy.young.travel.service;

import com.yy.young.dal.util.Page;
import com.yy.young.travel.model.Source;
import com.yy.young.travel.model.SourceGrade;

import java.util.List;

/**
 * 来源服务接口
 * Created by hua on 2018-03-21.
 */
public interface ISourceService {

    /**
     * 获取数据列表
     * @param source
     * @return
     * @throws Exception
     */
    List<Source> getSourceList(Source source) throws Exception;

    /**
     * 获取数据列表(分页)
     * @param source
     * @param page 分页参数
     * @return
     * @throws Exception
     */
    List<Source> getSourcePage(Source source, Page page) throws Exception;

    /**
     * 根据id获取信息
     * @param id
     * @return
     * @throws Exception
     */
    Source getSource(String id) throws Exception;

    /**
     * 修改
     * @param source
     * @return
     * @throws Exception
     */
    int updateSource(Source source) throws Exception;

    /**
     * 修改资源并且刷新得分信息
     * @param source
     * @return
     * @throws Exception
     */
    int updateSourceAndGrade(Source source, List<SourceGrade> list) throws Exception;

    /**
     * 批量删除
     * @param idArr id数组
     * @return
     * @throws Exception
     */
    int deleteSource(String[] idArr) throws Exception;

    /**
     * 删除单条
     * @param id
     * @return
     * @throws Exception
     */
    int deleteSource(String id) throws Exception;

    /**
     * 插入
     * @param source
     * @return
     * @throws Exception
     */
    int insertSource(Source source) throws Exception;

    /**
     * 插入资源信息和得分信息
     * @param source
     * @param list
     * @return
     * @throws Exception
     */
    int insertSourceAndGrade(Source source, List<SourceGrade> list) throws Exception;

}